﻿using System;

namespace Program05
{
    class Program
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Healthy healthy = new Healthy();

            bool sex = false;
            float height = 0;
            float weight = 0;

            Console.WriteLine("请输入性别(男/女)");
            string Sex = Console.ReadLine();
            while (!(Sex == "男" || Sex == "女"))
            {
                Console.WriteLine("请输入正确的数值");
                Sex = Console.ReadLine();                            
            }
            if (Sex == "男")
            {
                sex = true;
            }
            else if (Sex == "女") 
            {

                sex = false;
            }
            Console.WriteLine("请输入身高(cm)");

            while (height == 0 || height < 20)
            {
                string Height = Console.ReadLine();
                float.TryParse(Height, out height);
                if (height == 0 || height < 20)
                {
                    Console.WriteLine("请输入正确的数值");
                }
            }
            Console.WriteLine("请输入体重(kg)");
            while (weight == 0 || weight < 20)
            {

                string Weight = Console.ReadLine();
                float.TryParse(Weight, out weight);
                if (weight == 0 || weight < 20)
                {
                    Console.WriteLine("请输入正确的数值");
                }
               
            }
            Console.WriteLine(healthy.isHealthy(sex, height, weight));
            Console.ReadLine();
        }
    }
}
